<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>系统设置</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="/lib/layui-v2.5.5/css/layui.css" media="all">
    <link rel="stylesheet" href="/css/public.css" media="all">

    <!-- <style>
         .layui-form-item .layui-input-company {width: auto;padding-right: 10px;line-height: 38px;}
     </style>-->
</head>
<body>
<form class="layui-form">


            <div class="layui-form-item">
                <label class="layui-form-label">汇款日期:</label>
                <div class="layui-input-inline">
                    <input type="date" name="date" lay-verify="data" autocomplete="off" class="layui-input">
                </div>

        </div>

            <div class="layui-form-item">
                <label class="layui-form-label">汇款金额:</label>
                <div class="layui-input-inline">
                    <input type="text" name="money" autocomplete="off" class="layui-input">
                </div>

            </div>

        <div class="layui-form-item">
                <div class="layui-input-block">
                    <button class="layui-btn layui-btn-normal" lay-submit lay-filter="setting">提交</button>
                </div>

    </div>
</form>
<script src="/lib/layui-v2.5.5/layui.js" charset="utf-8"></script>
<script>
    layui.use(['form'], function () {
        var $ = layui.jquery;
        var form = layui.form
            , layer = layui.layer;

        //监听提交
        form.on('submit(setting)', function (data) {
            var date = $("input[name='date']").val();
            var money = $("input[name='money']").val();

            $.ajax({
                url:"/bank/addMoney.do",
                data:{
                    balance:money,
                    lastUpdateTime:date,
                },
                type:"get",
                dataType:"json",
                async: false,
                success:function (rec) {
                    if(rec.code==0){
                        alert("汇款成功")
                    }else {
                        alert("汇款失败")
                    }
                },
            })

        });
    });
</script>
</body>
</html>